﻿using System;
using System.Xml;
using System.Xml.XPath;
using System.IO;
using System.Collections;
using System.Data;
using System.Data.SqlClient;

namespace ELS.Configuration
{
    #region SqlConfigurationProvider
    /// <summary>
    /// Provides SQL server based persistence for configuration settings.
    /// </summary>
    public class SqlConfigurationProvider : ConfigurationProvider
    {
        #region variables
        private ConfigurationCollection _configurations = null;
        #endregion variables

        #region constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="ELS.Configuration.SqlConfigurationProvider"/> class.
        /// </summary>
        /// <param name="connectionString"> the file path for configuration data. </param>
        public SqlConfigurationProvider(string connectionString)
        {
            _configurations = new ConfigurationCollection();

            using(SqlConnection conn = new SqlConnection(connectionString))
            {

            }
        }

        #endregion constructors

        #region overrides
        /// <summary>
        /// Inherited from <see cref="ELS.Configuration.ProviderBase"/>.
        /// </summary>
        public override string Description
        {
            get { return "A class to provides SQL persistence for configuration settings."; }
        }

        /// <summary>
        /// Inherited from <see cref="ELS.Configuration.ProviderBase"/>.
        /// </summary>
        public override string Name
        {
            get { return "ELS.Configuration.SqlConfigurationProvider"; }
        }

        /// <summary>
        /// Inherited from <see cref="ELS.Configuration.ConfigurationProvider"/>.
        /// </summary>
        public override ConfigurationCollection Configurations
        {
            get { return _configurations; }
        }

        /// <summary>
        /// 
        /// </summary>
        public override void Save()
        {
            throw new NotImplementedException();
        }
        #endregion overrides
    }
    #endregion SqlConfigurationProvider
}
